/* 
 * File:   RotationDetector.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef ROTATIONCORRECTOR_H
#define ROTATIONCORRECTOR_H
#include <cv.h>
#include "ImageRotor.h"
#include <math.h>

/**
 * Class that represents a rotation
 * corrector of images.
 */
class RotationCorrector {
public:
    RotationCorrector();
    RotationCorrector(const RotationCorrector& orig);
    virtual ~RotationCorrector();
    IplImage* correctsRotation(IplImage* img);
    double getAngleOfRotation();
private:
    double angleOfRotation;
    
    double calculateOrientation(IplImage* img);
    double moment(IplImage* img, int p, int q);
    double centralMoment(IplImage* img, int p, int q);
};

#endif  /* ROTATIONCORRECTOR_H */